<?php
namespace app\index\controller;

use app\index\model\Question;

class Index extends Common
{
    public function index()
    {
      	$question = new Question();
      	$top = $question->getTop();
      	$data = $question->getAll();
      	$wenxin = $question->getwenxin();
      	$hotlist = $question->getHot();
      	$indexHot = $question->indexHot();
      	$hotUser = db('user')->order('answers desc')->limit(20)->select();
      	$link = db('link')->select();
      	$cate = db('cate')->select();
     	$this->view->engine->layout('newlayout');
        return $this->fetch('',[
          'title'=>'网站首页',
          'top'=>$top,
          'data'=>$data,
          'wenxin'=>$wenxin,
          'hotlist'=>$hotlist,
          'indexHot'=>$indexHot,
          'hotUser'=>$hotUser,
          'links'=>$link,
          'cate'=>$cate,
        ]);
    }
}
